package com.mornd.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.List;

import com.mornd.gulimall.common.core.entity.PageEntity;
import com.mornd.gulimall.common.core.validation.UpdateGroup;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 * 属性分组
 * </p>
 *
 * @author mornd
 * @since 2023-07-23
 */
@Getter
@Setter
@TableName("pms_attr_group")
public class AttrGroup extends PageEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 分组id
     */
    @NotNull(groups = UpdateGroup.class)
    @TableId(value = "attr_group_id", type = IdType.AUTO)
    private Long attrGroupId;

    /**
     * 组名
     */
    @NotBlank(message = "组名不能为空")
    @Size(max = 20)
    private String attrGroupName;

    /**
     * 排序
     */
    @NotNull
    @Min(0)
    private Integer sort;

    /**
     * 描述
     */
    private String descript;

    /**
     * 组图标
     */
    private String icon;

    /**
     * 所属分类id
     */
    @NotNull(message = "所属分类id不能为空")
    private Long catelogId;

    /**
     * 所属分类名称
     */
    @TableField(exist = false)
    private String catelogName;

    /**
     * 查询关键字
     */
    @TableField(exist = false)
    private String key;

    /**
     * 前端级联选择器回显的数组
     */
    @TableField(exist = false)
    private List<Long> catelogFrom;


}
